/*
 * @Author: “Jackson” “1145239633@qq.com”
 * @Date: 2025-08-06 16:12:57
 * @LastEditors: “Jackson” “1145239633@qq.com”
 * @LastEditTime: 2025-08-08 11:45:33
 * @FilePath: \shaangu-web\src\utils\echartsPie3d.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
let option;
export const getRedar = () => {
  option = {
      legend: {
      right: 10,
      // top: 10,
    },
    grid: {
      top: "10%",
      right: "10%",
      bottom: "10%",
      left: "10%",
    },
    radar: [
      {
        name: {
          textStyle: {
            fontSize: "16",
            color: "#333333",
          },
          formatter: function (params) {
            var str = "";
            switch (params) {
              case "学习度":
                str = "{d|}\n" + params + "";
                break;
              case "完成度":
                str = "{c|}\n" + params;
                break;
              case "成就度":
                str = "{b|}\n" + params;
                break;
              case "贡献度":
                str = "{a|}\n" + params;
                break;
              case "参与度":
                str = "{e|}\n" + params;
                break;
            }
            return str;
          },
          lineHeight: 30,
          rich: {
            a: {
              width: 16,
              height: 16,
              align: "center",
            },
            b: {
              width: 30,
              height: 30,
              align: "center",
            },
            c: {
              width: 30,
              height: 30,
              align: "center",
            },
            d: {
              width: 30,
              height: 30,
              align: "center",
            },
            e: {
              width: 30,
              height: 30,
              align: "center",
            },
          },
        },
        indicator: [
          {
            text: "学习度",
          },
          {
            text: "完成度",
          },
          {
            text: "成就度",
          },
          {
            text: "贡献度",
          },
          {
            text: "参与度",
          },
        ],
        center: ["50%", "55%"],  // 调整 center，向左移动
        radius: 94,  // 减小 radius，使雷达图更紧凑
        startAngle: 90,
        splitNumber: 4,
        splitArea: {
          areaStyle: {
            color: "#fff",
            shadowColor: "rgba(0, 0, 0, 0.3)",
            shadowBlur: 4,
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0091FF",
            width: 2,
          },
        },
        splitLine: {
          show: false,
          lineStyle: {
            color: "#0091FF",
            width: 2,
          },
        },
      },
    ],
    series: [
      {
        name: "雷达图",
        type: "radar",
        itemStyle: {
          emphasis: {
            // color: 各异,
            lineStyle: {
              width: 4,
            },
          },
        },
        data: [
          {
            value: [3300, 10000, 28000, 35000, 50000, 19000],
            name: "平均",
            itemStyle: {
              normal: {
                color: "#FF6666",
              },
            },
            areaStyle: {
              normal: {
                color: "#FF6666",
              },
            },
          },
          {
            value: [5000, 14000, 28000, 31000, 42000, 21000],
            name: "我",
            itemStyle: {
              normal: {
                color: "#39A5FE",
              },
            },
            areaStyle: {
              normal: {
                color: "#39A5FE",
              },
            },
          },
        ],
      },
    ],
  };
  return option;
};
